import 'package:flutter/material.dart';

class Mylistviewtwo extends StatelessWidget {
  const Mylistviewtwo({super.key});

  @override
  Widget build(BuildContext context) {
    return ListView.builder(itemBuilder: _itemBuilder);
  }
}

Widget _itemBuilder(BuildContext context, int index) {
  return Container(
    padding: const EdgeInsets.all(10),
    height: 100,
    child: Row(
      children: [
        //左
        Image.network(
          'https://yanxuan-item.nosdn.127.net/a09de222ed32efa8ffe359b1d5780574.jpg',
          width: 80,
          height: 80,
        ),
        const SizedBox(width: 10),
        //中
        const Expanded(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                '商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称',
                maxLines: 2,
                overflow: TextOverflow.ellipsis,
                style: TextStyle(fontSize: 16),
              ),
              SizedBox(height: 5),
              Text(
                '¥199.00',
                style: TextStyle(fontSize: 16, color: Colors.red),
              ),
            ],
          ),
        ),
        const SizedBox(width: 10),
        //右边
        const Icon(Icons.delete, size: 20),
      ],
    ),
  );
}
